package cn.yunhe.dao.impl;

import cn.yunhe.dao.IEmpDao;
import cn.yunhe.eneity.Emp;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import java.util.List;

@Getter
@Setter
@Repository

public class EmpDao extends HibernateTemplate implements IEmpDao {

    @Autowired
    @Qualifier(value = "sessionFactory")
    private SessionFactory sessionFactory;
    @Override
    public List<Emp> getAllEmps() {

        return find("from Emp");
    }
}
